git 本地改动了,不保留,直接拉取线上最新代码

您所在的位置:网站首页 git 强制更新远端 git 本地改动了,不保留,直接拉取线上最新代码

git 本地改动了,不保留,直接拉取线上最新代码

2023-11-20 19:31| 来源: 网络整理| 查看: 265

C# winform中 窗体缩放自适应的方法(不同电脑/不同分辨率)

sslyc8991: 缩放: [code=csharp] public void Scale() { _ = Form ?? throw new ArgumentNullException(nameof(Form), "请先调用Init进行初始化"); var scaleX = (double)Form.Width / InitWidth; var scaleY = (double)Form.Height / InitHeight; void ControlsChangeRec(Control ctrl) { foreach (Control item in ctrl.Controls)//遍历控件 { if (item.Name.Trim() != "")//如果控件名不是空,则执行 { if ((item as UserControl) == null && item.Controls.Count > 0)//如果不是自定义控件 { ControlsChangeRec(item); } var (left, top, width, height, fontSize) = ControlsInfo[item.Name]; double itemWidth = width * scaleX; double itemHeight = height * scaleY; item.Left = (int)(left * scaleX - itemWidth / 2); //距离左边距离 item.Top = (int)(top * scaleY - itemHeight / 2); //距离顶部距离 [/code]



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3